<#include "/common/head.ftl">
<@head>

<div class="container">
<form action="/api/user/register" method="post">
  <div class="form-group">
    <label for="userName1">用户名</label>
    <input type="text" class="form-control" id="userName1" placeholder="用户名"  name="userName" value="" required  autocomplete="off">
  </div>
  <div class="form-group">
    <label for="passwd1">密码</label>
    <input type="password" class="form-control" id="passwd1" placeholder="密码"  name="passwd" value="" required autocomplete="off">
  </div>
  <div class="form-group">
    <label for="phone1">手机号码</label>
    <input type="number" class="form-control" id="phone1" placeholder="手机号码"  name="phone" required autocomplete="off">
    用于找回密码使用
  </div>
  <div class="form-group">
    <label for="qq1">QQ号码</label>
    <input type="number" class="form-control" id="qq1" placeholder="QQ号码"  name="qq" required autocomplete="off">
  </div>
 
  <button type="submit" class="btn btn-default">注册提交</button>
</form>

 
</div>
 
    
<@js>
//-------


$("form").submit(function(e){
    e.preventDefault();
$.post("/api/user/register", $("form").serialize(),
          function(data){
          console.log(data); //  2pm
         if(data.status==200){
			window.location.href='/';
         }
            alert(data.message);     
         }, "json");
    
});



</@js>

</@head>